<!DOCTYPE html>
<html lang="zh"xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>首页 - 天才(genius)后台管理系统</title>
<link rel="icon" th:href="@{favicon.ico}" type="image/ico">
  <link href="css/bootstrap.min.css" th:href="@{~/css/bootstrap.min.css}" rel="stylesheet">
  <link href="css/materialdesignicons.min.css" th:href="@{~/css/materialdesignicons.min.css}" rel="stylesheet">
  <link href="css/style.min.css" th:href="@{~/css/style.min.css}" rel="stylesheet">

</head>

<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
    <aside th:include="left::common" class="lyear-layout-sidebar">
    </aside>
    <!--End 左侧导航-->
    <!--头部信息-->
    <header th:include="head :: common" class="lyear-layout-header">
    </header>
    <!--End 头部信息-->
    <!--页面主要内容-->
    <main class="lyear-layout-content">
     <div class="col-md-12">
        <div class="card">
          <div class="card-header">

          </div>

          <form id="biao" action="/study-test-questions-one/study_shijuan_add" method="post">
          <input type="hidden" th:value="${pInfoOne.pageNum}" id="pnone" name="pnone" />
          <input type="hidden" value="" id="paginalsizeone" name="paginalsizeone" />
          <input type="hidden" value="" id="oneval" name="oneval" />
          <input type="hidden" th:value="${pInfoMore.pageNum}" id="pnmore" name="pnmore" />
          <input type="hidden" value="" id="paginalsizemore" name="paginalsizemore" />
          <input type="hidden" value="" id="moreval" name="moreval" />
          <input type="hidden" th:value="${pInfoShor.pageNum}" id="pnshort" name="pnshort" />
          <input type="hidden" value="" id="paginalsizeshort" name="paginalsizeshort" />
          <input type="hidden" value="" id="shoreval" name="shoreval" />
          <input type="hidden" value="" id="oms" name="oms"/>
        </form>

          <div class="card-body">
            <ul class="nav nav-tabs nav-justified">
              <li th:class="${#strings.equals(oms,'one')?'active':''}">
                <a data-toggle="tab" href="#home-basic">单选</a>
              </li>
              <li  th:class="${#strings.equals(oms,'more')?'active':''}" class="nav-item">
                <a data-toggle="tab" href="#profile-basic">多选</a>
              </li>
              <li  th:class="${#strings.equals(oms,'shore')?'active':''}" class="nav-item">
                <a data-toggle="tab" href="#messages-basic">简答</a>
              </li>
            </ul>

            <div class="tab-content">


              <!--单选!-->

              <div th:class="${#strings.equals(oms,'one')?'tab-pane fade active in':'tab-pane fade'}" class="tab-pane fade " id="home-basic">
                <form id="dan" action="/study-test-questions-one/savee" method="post">
                <h4>请选择要增加到哪个试卷:&nbsp;&nbsp;</h4>
                <div class="select1">
                  <select id="sel"name="pageid">
                    <option value="1">请选择</option>
                    <tr th:each="page:${pagelist}">
                      <option id="sss0" th:value="${page.id}">[[${page.testPaperName}]]</option>
                    </tr>
                  </select>
                </div>
                <table class="table">
                  <thead>
                  <tr>
                    <th>#</th>
                    <th>题目</th>
                    <th>答案</th>
                    <th>请勾选</th>
                  </tr>
                  </thead>

                  <tr th:each="one:${pInfoOne.list}">
                    <th th:text="${one.id}"></th>
                     <td th:text="${one.testQuestionsOneOpic}"></td>
                     <td th:text="${one.testQuestionsOneAnswer}"></td>
                    <td><input type="checkbox" th:value="${one.id}"class="ads" name="checkedid"/></td>
                    </tr>
                  </tbody>
                </table>
                  <button type="button" class="btn btn-primary" id="svemp" data-toggle="modal" data-target=".bs-example-modal-sm">试卷添加试题</button>
                  <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
                    <div class="modal-dialog modal-sm" role="document">
                      <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                          <h4 class="modal-title" id="myLargeModalLabel">试卷新增</h4>
                        </div>
                        <div class="modal-body">
                          是否确认添加😊
                        </div>
                        <div class="modal-footer">
                          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                          <button type="button" onclick="add()" class="btn btn-primary">点击保存</button>
                        </div>
                      </div>
                    </div>
                  </div>
                  <!-- <div class="col-sm-9">
                      <label th:each="one:${pInfoOne.list}" class="check-box">
                          <input id="pInfoOne" name="pInfoOne" type="checkbox" th:value="${one.id}" th:text="${one.testQuestionsOneOpic},${one.testQuestionsOneAnswer}">
                      </label>
                  </div>-->
               <!-- <nav>
                  <div class="col-md-4">总记录数[[${pInfoOne.total}]] [[${pInfoOne.pageNum}]]/
                    [[${pInfoOne.pages}]]页</div>
                  <ul class="pagination pagination-circle">
                    <li th:class="${pInfoOne.isFirstPage}?'disabled'" >
                      <a href="javascript:;"  th:onclick="'ymone('+${pInfoOne.prePage}+')'">
                        <span><i class="mdi mdi-chevron-left"></i></span>
                      </a>
                    </li>
                    <li th:class="${page_Num==pInfoOne.pageNum}?'active':''" th:each="page_Num:${pInfoOne.navigatepageNums}">
                      <a  th:onclick="'ymone('+${page_Num}+')'" href="javascript:;">[[${page_Num}]]</a>
                    </li>

                    <li th:class="${pInfoOne.isLastPage}?'disabled'">
                      <a href="javascript:;" th:onclick="'ymone('+${pInfoOne.nextPage}+')'">
                        <span><i class="mdi mdi-chevron-right"></i></span>
                      </a>
                    </li>

                  </ul>

                </nav>-->
                </form>
              </div>





          <!--多选!-->

              <div th:class="${#strings.equals(oms,'more')?'tab-pane fade active in ':'tab-pane fade'}" class="tab-pane fade" id="profile-basic">
                <form id="duo" action="/study-test-questions-more/savee" method="post">
                <h4>请选择要增加到哪个试卷:&nbsp;&nbsp;</h4>
                <div class="select1">
                  <select id="sel1"name="pageid">
                    <option value="1">请选择</option>
                    <tr th:each="page:${pagelist}">
                      <option id="sss1" th:value="${page.id}" >[[${page.testPaperName}]]</option>
                    </tr>
                  </select>
                </div>
                <table class="table">
                  <thead>
                  <tr>
                    <th>#</th>
                    <th>题目</th>
                    <th>答案</th>
                    <th>请勾选</th>
                  </tr>
                  </thead>
                  <tbody>
                   <tr th:each="more:${pInfoMore.list}">
                      <th th:text="${more.id}"></th>
                      <td th:text="${more.testQuestionsMoreOpic}"></td>
                      <td th:text="${more.testQuestionsMoreAnswer}"></td>
                     <td><input type="checkbox" th:value="${more.id}"class="ads" name="checkedid"/></td>
                  </tr>
                  </tbody>
                </table>
                  <button type="button" class="btn btn-primary" id="svemp1" data-toggle="modal" data-target=".bs-example-modal-sm">试卷添加试题</button>
                  <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
                    <div class="modal-dialog modal-sm" role="document">
                      <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                          <h4 class="modal-title" id="myLargeModalLabel1">试卷新增</h4>
                        </div>
                        <div class="modal-body">
                          是否确认添加😊
                        </div>
                        <div class="modal-footer">
                          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                          <button type="button" onclick="add1()" class="btn btn-primary">点击保存</button>
                        </div>
                      </div>
                    </div>
                  </div>
<!--                <nav>-->
<!--                  <div class="col-md-4">总记录数[[${pInfoMore.total}]] [[${pInfoMore.pageNum}]]/-->
<!--                    [[${pInfoMore.pages}]]页</div>-->
<!--                  <ul class="pagination pagination-circle">-->
<!--                    <li th:class="${pInfoMore.isFirstPage}?'disabled'" >-->
<!--                      <a href="javascript:;"  th:onclick="'ymmore('+${pInfoMore.prePage}+')'">-->
<!--                        <span><i class="mdi mdi-chevron-left"></i></span>-->
<!--                      </a>-->
<!--                    </li>-->
<!--                    <li th:class="${page_Num==pInfoMore.pageNum}?'active':''" th:each="page_Num:${pInfoMore.navigatepageNums}">-->
<!--                      <a  th:onclick="'ymmore('+${page_Num}+')'" href="javascript:;">[[${page_Num}]]</a>-->
<!--                    </li>-->
<!--                    <li th:class="${pInfoMore.isLastPage}?'disabled'">-->
<!--                      <a href="javascript:;" th:onclick="'ymmore('+${pInfoMore.nextPage}+')'">-->
<!--                        <span><i class="mdi mdi-chevron-right"></i></span>-->
<!--                      </a>-->
<!--                    </li>-->

<!--                  </ul>-->

<!--                </nav>-->
                </form>
              </div>

              <!--简答!-->

              <div th:class="${#strings.equals(oms,'shore')?'tab-pane fade active in':'tab-pane fade'}" class="tab-pane fade" id="messages-basic">
                <form id="jian" action="/study-test-questions-shortanswer/savee" method="post">
                <h4>请选择要增加到哪个试卷:&nbsp;&nbsp;</h4>
                <div class="select1">
                  <select id="sel2"name="pageid">
                    <option value="1">请选择</option>
                    <tr th:each="page:${pagelist}">
                      <option id="sss2" th:value="${page.id}" >[[${page.testPaperName}]]</option>
                    </tr>
                  </select>
                </div>

                <table class="table">
                  <thead>
                  <tr>
                    <th>#</th>
                    <th>题目</th>
                    <th>答案</th>
                    <th>请勾选</th>
                  </tr>
                  </thead>
                  <tbody >
                  <tr th:each="short:${pInfoShor.list}">
                    <th th:text="${short.id}"text-maxlength="10"></th>
                    <td th:text="${short.testQuestionsShortanswerOpic}"text-maxlength="10"></td>
                    <td> <textarea name="txt" clos="20"rows="5" wrap="virtual"th:text="${short.testQuestionsShortanswerAnswer}"></textarea></td>
                    <td><input type="checkbox" th:value="${short.id}"class="ads" name="checkedid"/></td>
                  </tr>
                  </tbody>
                </table>
                  <button type="button" class="btn btn-primary" id="svemp2" data-toggle="modal" data-target=".bs-example-modal-sm">试卷添加试题</button>
                  <div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
                    <div class="modal-dialog modal-sm" role="document">
                      <div class="modal-content">
                        <div class="modal-header">
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                          <h4 class="modal-title" id="myLargeModalLabel2">试卷新增</h4>
                        </div>
                        <div class="modal-body">
                          是否确认添加😊
                        </div>
                        <div class="modal-footer">
                          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                          <button type="button" onclick="add2()" class="btn btn-primary">点击保存</button>
                        </div>
                      </div>
                    </div>
                  </div>
                <!--<nav>
                  <div class="col-md-4">总记录数[[${pInfoShor.total}]] [[${pInfoShor.pageNum}]]/
                    [[${pInfoShor.pages}]]页</div>
                  <ul class="pagination pagination-circle">
                    <li th:class="${pInfoShor.isFirstPage}?'disabled'" >
                      <a href="javascript:;"  th:onclick="'ymshore('+${pInfoShor.prePage}+')'">
                        <span><i class="mdi mdi-chevron-left"></i></span>
                      </a>
                    </li>
                    <li th:class="${page_Num==pInfoShor.pageNum}?'active':''" th:each="page_Num:${pInfoShor.navigatepageNums}">
                      <a  th:onclick="'ymshore('+${page_Num}+')'" href="javascript:;">[[${page_Num}]]</a>
                    </li>
                    <li th:class="${pInfoShor.isLastPage}?'disabled'">
                      <a href="javascript:;" th:onclick="'ymshore('+${pInfoShor.nextPage}+')'">
                        <span><i class="mdi mdi-chevron-right"></i></span>
                      </a>
                    </li>

                  </ul>

                </nav>-->
                </form>
              </div>
            </div>
            </div>

          </div>


</div>

    </main>
    <!--End 页面主要内容-->




  </div>
</div>
<!--<div class="example-box">
  <label class="lyear-checkbox">
    <input type="checkbox">
    <span>默认复选框</span>
  </label>
  <label class="lyear-checkbox m-t-10">
    <input type="checkbox" checked="">
    <span>选中的</span>
  </label>
  <label class="lyear-checkbox checkbox-grey m-t-10">
    <input type="checkbox">
    <span>灰色背景复选框</span>
  </label>
  <label class="lyear-checkbox m-t-10">
    <input type="checkbox" disabled="">
    <span>禁用的</span>
  </label>
</div>-->
<script type="text/javascript" th:src="@{~/js/jquery.min.js}" src="js/jquery.min.js"></script>
<script type="text/javascript" th:src="@{~/js/bootstrap.min.js}" src="js/bootstrap.min.js"></script>
<script type="text/javascript" th:src="@{~/js/perfect-scrollbar.min.js}" src="js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" th:src="@{~/js/main.min.js}" src="js/main.min.js"></script>

<!--图表插件-->
<script type="text/javascript" th:src="@{~/js/Chart.js}" src="js/Chart.js"></script>
<script type="text/javascript">

  window.onload = function() {
    $("#checkAll").bind("click", function () {
    debugger;
      if (this.checked) {
        $("[name = checkItem]:checkbox").attr("checked", true);
      }
      else {
        $("[name = checkItem]:checkbox").attr("checked", false);
      }
    });
  }
  function  add() {
  debugger
    var chekid=[];
  $("input[name='checkedid']:checked").each(function (i) {
    chekid[i]=$(this).val();
  })

 /*   alert(chekid);*/
    $("#dan").submit();
  }
  function  add1() {
  debugger
    var chekid=[];
    $("input[name='checkedid']:checked").each(function (i) {
      chekid[i]=$(this).val();
    })

   /* alert(chekid);*/
    $("#duo").submit();
  }
  function  add2() {
  debugger
    var chekid=[];
    $("input[name='checkedid']:checked").each(function (i) {
      chekid[i]=$(this).val();
    })

    // alert(chekid);
    $("#jian").submit();
  }
   /* //多选按钮实现
    selAll = document.getElementById("selAll");
    hobbys = document.getElementsByName("hobby");
    fx = document.getElementById("fx");
    //全选事件
    selAll.onclick = function(){
      //全选
      if(selAll.checked == true){
        for (var i=0;i<hobbys.length;i++) {
          hobbys[i].checked = true;
        }
      }else{
        for (var i=0;i<hobbys.length;i++) {
          hobbys[i].checked = false;
        }
      }
    }
    //反选
    fx.onclick = function(){
      for (var i=0;i<hobbys.length;i++) {
        var b = hobbys[i];
        if(b.checked == true){
          b.checked = false;
        }else{
          b.checked = true;
        }
      }
    }*/


  function ymone(pn){
    var oneval1=$("#oneval1").val();
    var paginalsizeone1=$("#paginalsizeone1").val();
    var moreval1=$("#moreval1").val();
    var paginalsizemore1=$("#paginalsizemore1").val();
    var shoreval1=$("#shoreval1").val();
    var paginalsizeshort1=$("#paginalsizeshort1").val();
  if(pn==0){
    return
  }
    $("#pnone").attr("value", pn);
    $("#paginalsizeone").attr("value", paginalsizeone1);
    $("#oneval").attr("value", oneval1);
    $("#paginalsizemore").attr("value", paginalsizemore1);
    $("#moreval").attr("value", moreval1);
    $("#paginalsizeshort").attr("value", paginalsizeshort1);
    $("#shoreval").attr("value", shoreval1);
    $("#oms").attr("value", "one");
    $("#biao").submit();

  }
  function ymshore(pn){
    var oneval1=$("#oneval1").val();
    var paginalsizeone1=$("#paginalsizeone1").val();
    var moreval1=$("#moreval1").val();
    var paginalsizemore1=$("#paginalsizemore1").val();
    var shoreval1=$("#shoreval1").val();
    var paginalsizeshort1=$("#paginalsizeshort1").val();
    if(pn==0){
      return
    }
    $("#pnshort").attr("value", pn);
    $("#paginalsizeone").attr("value", paginalsizeone1);
    $("#oneval").attr("value", oneval1);
    $("#paginalsizemore").attr("value", paginalsizemore1);
    $("#moreval").attr("value", moreval1);
    $("#paginalsizeshort").attr("value", paginalsizeshort1);
    $("#shoreval").attr("value", shoreval1);
    $("#oms").attr("value", "shore");
    $("#biao").submit();

  }
  function ymmore(pn){
    var oneval1=$("#oneval1").val();
    var paginalsizeone1=$("#paginalsizeone1").val();
    var moreval1=$("#moreval1").val();
    var paginalsizemore1=$("#paginalsizemore1").val();
    var shoreval1=$("#shoreval1").val();
    var paginalsizeshort1=$("#paginalsizeshort1").val();
    if(pn==0){
      return
    }
    $("#pnmore").attr("value", pn);
    $("#paginalsizeone").attr("value", paginalsizeone1);
    $("#oneval").attr("value", oneval1);
    $("#paginalsizemore").attr("value", paginalsizemore1);
    $("#moreval").attr("value", moreval1);
    $("#paginalsizeshort").attr("value", paginalsizeshort1);
    $("#shoreval").attr("value", shoreval1);
    $("#oms").attr("value", "more");
    $("#biao").submit();

  }
$(document).ready(function(e) {
    var $dashChartBarsCnt  = jQuery( '.js-chartjs-bars' )[0].getContext( '2d' ),
        $dashChartLinesCnt = jQuery( '.js-chartjs-lines' )[0].getContext( '2d' );

    var $dashChartBarsData = {
		labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
		datasets: [
			{
				label: '注册用户',
                borderWidth: 1,
                borderColor: 'rgba(0,0,0,0)',
				backgroundColor: 'rgba(51,202,185,0.5)',
                hoverBackgroundColor: "rgba(51,202,185,0.7)",
                hoverBorderColor: "rgba(0,0,0,0)",
				data: [2500, 1500, 1200, 3200, 4800, 3500, 1500]
			}
		]
	};
    var $dashChartLinesData = {
		labels: ['2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014'],
		datasets: [
			{
				label: '交易资金',
				data: [20, 25, 40, 30, 45, 40, 55, 40, 48, 40, 42, 50],
				borderColor: '#358ed7',
				backgroundColor: 'rgba(53, 142, 215, 0.175)',
                borderWidth: 1,
                fill: false,
                lineTension: 0.5
			}
		]
	};

    new Chart($dashChartBarsCnt, {
        type: 'bar',
        data: $dashChartBarsData
    });

    var myLineChart = new Chart($dashChartLinesCnt, {
        type: 'line',
        data: $dashChartLinesData,
    });
});
</script>
</body>
</html>